﻿package com.shangda.Thread;

import java.util.List;
import java.util.concurrent.BlockingQueue;

import com.shangda.entity.ReceiveData;
import com.shangda.service.DataService;

public class DataBaseSave extends Thread{
	private BlockingQueue<List<ReceiveData>> receiveAll;
	private DataService dataService;
	public DataBaseSave(BlockingQueue<List<ReceiveData>> receiveAll,DataService dataService){
		this.receiveAll = receiveAll;
		this.dataService = dataService;
	}
	@Override
	public void run() {
		while(true){
			try {
				List<ReceiveData> receiveDatas =  receiveAll.take();
				dataService.DataSaveOrgin(receiveDatas);
			} catch (Exception e) {
				
				e.printStackTrace();
			}
		}
	}

}
